from django.urls import path
from . import views

app_name = 'user'

urlpatterns = [
    path('login/', views.user_login, name='user_login'),
    path('register/', views.user_register, name='user_register'),
    path('dashboard/', views.dashboard, name='dashboard'),
    # 统一使用search_rooms处理房间搜索和预订
    path('search_rooms/', views.search_rooms, name='search_rooms'),
    # 保留book路由以兼容旧链接，重定向到search_rooms
    path('book/', views.book_room, name='book_room'),
    path('cancel_booking/<int:booking_id>/', views.cancel_booking, name='cancel_booking'),
    path('pay_bill/<int:bill_id>/', views.pay_bill, name='pay_bill'),
    path('feedback/', views.submit_feedback, name='submit_feedback'),
    path('download-invoice/<int:bill_id>/', views.download_invoice, name='download_invoice'),
    path('logout/', views.user_logout, name='logout'),
]
